class Person {
    name: string
    age: number

    constructor(name: string, age: number) {
        this.name = name
        this.age = age
    }
}

// Student类有自己的属性,同时继承了父类Person的属性
class Student extends Person {
    address: string

    constructor(name: string, age: number, address: string) {
        // 在构造函数中通过super()函数来调用父类的构造函数,对父类的属性进行初始化
        super(name, age);
        this.address = address
    }
}

const s: Student = new Student("陶品奇", 22, "衡阳")
console.log(s)